home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Visual Basic Source Code
/
Visual Basic Source Code.iso
/
vbsource
/
dblrou1r
/
main.frm
< prev
next >
Wrap
Text File
|
1998-11-04
|
15KB
|
460 lines
VERSION 5.00
Begin VB.Form Form1
BackColor = &H00000000&
BorderStyle = 0 'None
Caption = "Form1"
ClientHeight = 7200
ClientLeft = 0
ClientTop = 0
ClientWidth = 9600
FillStyle = 0 'Solid
Icon = "main.frx":0000
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 480
ScaleMode = 3 'Pixel
ScaleWidth = 640
ShowInTaskbar = 0 'False
StartUpPosition = 2 'CenterScreen
WindowState = 2 'Maximized
Begin VB.Frame Frame1
BackColor = &H00000000&
Caption = "-=Game=-"
BeginProperty Font
Name = "Fixedsys"
Size = 9
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H000000FF&
Height = 7095
Left = 7200
TabIndex = 0
Top = 0
Width = 2295
Begin VB.CommandButton btnOutPut
DisabledPicture = "main.frx":0E42
DownPicture = "main.frx":21FC
BeginProperty Font
Name = "Comic Sans MS"
Size = 14.25
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
Left = 120
Picture = "main.frx":502E
Style = 1 'Graphical
TabIndex = 6
Top = 2520
Width = 2055
End
Begin VB.CommandButton btnPlay
DisabledPicture = "main.frx":7E60
DownPicture = "main.frx":921A
BeginProperty Font
Name = "Fixedsys"
Size = 9
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
Left = 120
Picture = "main.frx":C04C
Style = 1 'Graphical
TabIndex = 5
TabStop = 0 'False
Top = 1080
Width = 2055
End
Begin VB.CommandButton btnQuit
DisabledPicture = "main.frx":EE7E
DownPicture = "main.frx":10238
BeginProperty Font
Name = "Fixedsys"
Size = 9
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
Left = 120
Picture = "main.frx":1306A
Style = 1 'Graphical
TabIndex = 4
TabStop = 0 'False
Top = 6360
Width = 2055
End
Begin VB.CommandButton btnPauseResume
DisabledPicture = "main.frx":15E9C
DownPicture = "main.frx":17256
BeginProperty Font
Name = "Fixedsys"
Size = 9
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
Left = 120
Picture = "main.frx":1A088
Style = 1 'Graphical
TabIndex = 1
TabStop = 0 'False
Top = 1800
Width = 2055
End
Begin VB.Label Label2
BackStyle = 0 'Transparent
Caption = "Player2:"
BeginProperty Font
Name = "Fixedsys"
Size = 9
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00FF0000&
Height = 255
Left = 120
TabIndex = 3
Top = 600
Width = 2055
End
Begin VB.Label Label1
BackStyle = 0 'Transparent
Caption = "Player1:"
BeginProperty Font
Name = "Fixedsys"
Size = 9
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H000000FF&
Height = 255
Left = 120
TabIndex = 2
Top = 360
Width = 2055
End
End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
' Most of the game stuff if stuck in here... Feel free to browse the mess! It all works
' btw!!! :)
' This is the main game loop flag. To exit the program, just make bActive false
Private bActive As Boolean
' This is the playing loop flag. To pause the game from playing, make this false
Private bPaused As Boolean
' If the game screen should be refreshed (Redrawn), set this to false
Private bRefreshed As Boolean
' This is player1
Private Player1 As New Player
' This is player 2
Private Player2 As New Player
' This is our customised, and infinitely kooler, messagebox
Private MesBox As New MessBox
' Game input. Uses my own class wrapper for DirectInput which is part of the CDXVB
' library of class wrappers for DirectX in VB
Private GameIN As New CDXVBInput
Private GameMusic As New CDXVBMusic
Private Sub btnOutPut_Click()
GameIN.UnAcquire
OutPutfrm.Show vbModal, Me
GameIN.ReAcquire
' Redraw the screen
bRefreshed = False
End Sub
Private Sub btnPauseResume_Click()
' If the game is currently paused then load new bitmaps into pause/resume button
' Otherwise, load other bitmaps
If bPaused Then
' This little thang I thunk up is well handy... Checks to see if you are
' in the root of the drive (\), if so, then load bitmaps without the '\'
' in the pathname! (Prevents crashing when running from root like some
' people may wish to)
If Mid(App.Path, 2, 1) = "\" Then
btnPauseResume.Picture = LoadPicture(App.Path & "PAUSE.BMP")
btnPauseResume.DisabledPicture = LoadPicture(App.Path & "PAUSEOFF.BMP")
btnPauseResume.DownPicture = LoadPicture(App.Path & "PAUSEDOWN.BMP")
Else
btnPauseResume.Picture = LoadPicture(App.Path & "\PAUSE.BMP")
btnPauseResume.DisabledPicture = LoadPicture(App.Path & "\PAUSEOFF.BMP")
btnPauseResume.DownPicture = LoadPicture(App.Path & "\PAUSEDOWN.BMP")
End If
bPaused = False
Else
If Mid(App.Path, 2, 1) = "\" Then
btnPauseResume.Picture = LoadPicture(App.Path & "RESUME.BMP")
btnPauseResume.DisabledPicture = LoadPicture(App.Path & "RESUM